<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <title th:text="${operator}"></title>
    <script type="text/javascript" th:src="${domain}+'/web-apps/apps/api/documents/api.js'"></script>
</head>
<body style="height: 100vh; margin: 0;">
<div id="placeholder" style="height: 100%"></div>

<script th:inline="javascript">
    var ctx = [[${ctx}]];
    var userId = [[${userId}]];
    var userName = [[${userName}]];
    var fileType = [[${fileType}]];
    var key = [[${key}]];
    var title = [[${title}]];
    var url = [[${url}]];
    var edit = [[${edit}]];
    var documentType = [[${documentType}]];
    var callbackUrl = [[${callbackUrl}]];
</script>
<script type="text/javascript">
    window.docEditor = new DocsAPI.DocEditor("placeholder",
        {
            "document": {
                "fileType": fileType,
                "key": key,
                "title": title,
                "url": decodeURIComponent(url),
                "permissions": {
                    "edit": edit,
                }
            },
            "documentType": documentType,
            "editorConfig": {
                "lang": "zh-CN",
                "callbackUrl": callbackUrl,
                "user": {
                    "id": userId,
                    "name": userName
                }
            },
            "height": "100%",
            "width": "100%"
        });
</script>
</body>
</html>
